import {
  Complex
} from '../api/complex'

class LikeModel extends Complex {
  like (behavior, artId, category) {
    let url = behavior === 'like' ? 'like' : 'like/cancel'
    return this.$axios({
      url: url,
      method: 'post',
      data: {
        art_id: artId,
        type: category
      }
    })
  }

  getClassicLikeStatus (artId, category) {
    return this.$axios({
      url: `classic/${category}/${artId}/favor`
    })
  }
}

export {
  LikeModel
}
